//
// Created by admin on 2024/3/29.
// 素数埃氏筛法
//


#include<iostream>
#include<cmath>

using namespace std;

int main()
{
    int n = 100, ret = 0;
    n = 1740948; // out: 130971
//    n = 1152761; // out: 89503
//    n = 2795431; // out: 203047
//    cin>>n;
    bool p[n + 1] = {0};
    for (int i = 2; i <= n; ++i)
        p[i] = 1;
    for (int i = 2; i * i <= n; ++i)
    {
        if (p[i])
        {
            for (int j = i + i; j <= n; j += i)
            {
                p[j] = 0;
            }
        }
    }
    for (int i = 0; i <= n; ++i)
    {
        if (p[i])
            ++ret;
    }
    cout << ret;
    return 0;
}
